package cn.maszy.common;

import cn.maszy.model.systemsetting.C_V_Sys_LoginInfo;

import com.opensymphony.xwork2.ActionContext;

public class SessionFactory {
	
	/**
	 * 获取用户ID
	 * @Author:Arthur
	 * @Time:2012-11-1
	 * @Parameter:@return
	 * @Return:String
	 * @Throws
	 */
	public  static String getSessionUserId() {
		C_V_Sys_LoginInfo	c_V_Sys_LoginInfo = (C_V_Sys_LoginInfo)ActionContext.getContext().getSession().get(LoginFilter.USER_SESSION);
		return c_V_Sys_LoginInfo.getAdminId();
	}
	/**
	 * 获取用户登录名
	 * @Author:Arthur
	 * @Time:2012-11-1
	 * @Parameter:@return
	 * @Return:String
	 * @Throws
	 */
	public static String getSessionUserName(){
		C_V_Sys_LoginInfo	c_V_Sys_LoginInfo = (C_V_Sys_LoginInfo)ActionContext.getContext().getSession().get(LoginFilter.USER_SESSION);
		return c_V_Sys_LoginInfo.getLoginName();
	}
	/**
	 * 获取用户角色ID
	 * @Author:Arthur
	 * @Time:2012-11-1
	 * @Parameter:@return
	 * @Return:String
	 * @Throws
	 */
	public static String getSessionUserRoleID(){
		C_V_Sys_LoginInfo	c_V_Sys_LoginInfo = (C_V_Sys_LoginInfo)ActionContext.getContext().getSession().get(LoginFilter.USER_SESSION);
		return c_V_Sys_LoginInfo.getRoleid();
	}
	
	/**
	 * 获取用户真实名称
	 * @Author:Arthur
	 * @Time:2012-11-1
	 * @Parameter:@return
	 * @Return:String
	 * @Throws
	 */
	public static String getSessionUserRealNam(){
		C_V_Sys_LoginInfo	c_V_Sys_LoginInfo = (C_V_Sys_LoginInfo)ActionContext.getContext().getSession().get(LoginFilter.USER_SESSION);
		return c_V_Sys_LoginInfo.getRealName();
	}
	/**
	 * 获取用户所在部门
	 * @Author:Arthur
	 * @Time:2012-11-1
	 * @Parameter:@return
	 * @Return:String
	 * @Throws
	 */
	public static String getSessionUserDepNam(){
		C_V_Sys_LoginInfo	c_V_Sys_LoginInfo = (C_V_Sys_LoginInfo)ActionContext.getContext().getSession().get(LoginFilter.USER_SESSION);
		return c_V_Sys_LoginInfo.getDepname();
	}
	/**
	 * 获取用户所在单位
	 * @Author:Arthur
	 * @Time:2012-11-1
	 * @Parameter:@return
	 * @Return:String
	 * @Throws
	 */
	public static String getSessionUserUnitNam(){
		C_V_Sys_LoginInfo	c_V_Sys_LoginInfo = (C_V_Sys_LoginInfo)ActionContext.getContext().getSession().get(LoginFilter.USER_SESSION);
		return c_V_Sys_LoginInfo.getUnitname();
	}
	/**
	 * 获取用户id
	 * @return
	 */
	public static String getSessionEmployeeId(){
		C_V_Sys_LoginInfo	c_V_Sys_LoginInfo = (C_V_Sys_LoginInfo)ActionContext.getContext().getSession().get(LoginFilter.USER_SESSION);
		return c_V_Sys_LoginInfo.getEmployeeid();
	}
}
